package com.lbs.jiepiaisi.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lbs.jiepiaisi.fragment.NewsListFragment;
import com.lbs.jiepiaisi.fragment.WorkOrderListFragment;
import com.lbs.jiepiaisi.utils.Constant;

/**
 *
 * 时间：2018/1/12 15:29
 * 作用：
 */

public class WorkOrderViewPagerAdapter extends FragmentPagerAdapter {

    private String type[]=new String[]{Constant.WORK_ORDER_HAVE_GET,
            Constant.WORK_ORDER_NO_GET,
            Constant.WORK_ORDER_HISTORY_GET
    };
    private String title[]=new String[]{"已接工单",
            "未接工单",
            "历史工单"
    };
    private String installerId;

    public WorkOrderViewPagerAdapter(FragmentManager fm,String installerId) {
        super(fm);
        this.installerId = installerId;
    }

    @Override
    public Fragment getItem(int position) {
        return WorkOrderListFragment.getInstance(type[position],installerId);
    }

    @Override
    public int getCount() {
        return title.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
